using MediatR;
using S.M.SmartMedical.Domain.DTOs;
using S.M.SmartMedical.ErrorCode;

namespace S.M.SmartMedical.API.Write.Application.Command
{
    /// <summary>
    /// 更新医院命令对象
    /// 用于处理医院更新请求
    /// </summary>
    public class UpdateHospitalCommand : IRequest<APIResult<HospitalDto>>
    {
        /// <summary>
        /// 医院ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 医院名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 医院图片URL
        /// </summary>
        public string ImageUrl { get; set; } = string.Empty;

        /// <summary>
        /// 医院等级
        /// </summary>
        public string Level { get; set; } = string.Empty;

        /// <summary>
        /// 医院类型
        /// </summary>
        public string Type { get; set; } = string.Empty;

        /// <summary>
        /// 医院地址
        /// </summary>
        public string Address { get; set; } = string.Empty;

        /// <summary>
        /// 联系电话
        /// </summary>
        public string Phone { get; set; } = string.Empty;

        /// <summary>
        /// 医院描述
        /// </summary>
        public string Description { get; set; } = string.Empty;

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; } = true;

        /// <summary>
        /// 构造函数
        /// </summary>
        public UpdateHospitalCommand()
        {
        }

        /// <summary>
        /// 构造函数，从更新DTO初始化
        /// </summary>
        /// <param name="updateDto">医院更新DTO</param>
        public UpdateHospitalCommand(HospitalUpdateDto updateDto)
        {
            Id = updateDto.Id;
            Name = updateDto.Name;
            ImageUrl = updateDto.ImageUrl;
            Level = updateDto.Level;
            Type = updateDto.Type;
            Address = updateDto.Address;
            Phone = updateDto.Phone;
            Description = updateDto.Description;
            IsEnabled = updateDto.IsEnabled;
        }
    }
}